home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / Small Demos / stwice.icl < prev    next >
Encoding:
Text File  |  1997-06-20  |  529 b   |  23 lines  |  [TEXT/3PRM]

  1. module stwice
  2.  
  3. /*
  4. The strict Twice function.
  5.  
  6. An integer (0) is incremented 65536 times using the higher
  7. order function Twice. The Twice function has a local
  8. strictness annotation which makes it more efficient.
  9.  
  10. To generate an application for this program the Clean 0.8
  11. application should be set to at least 1.1 Mb. To launch the
  12. generated application another 400K of free memory is needed.
  13. */
  14.  
  15. import StdEnv
  16.  
  17. Twice::(a -> a) a -> a
  18. Twice f x    =    let! evalfx = f x
  19.                 in f evalfx
  20.  
  21. Start::Int
  22. Start = Twice Twice Twice Twice inc 0
  23.